I am facing a very strange problem. |
Re: Restoring Links from target module.
I think the follow link will find an object NEAR the link-source-object, if that source is excluded from the current view. It may also happen when the source object is deleled. But I see you get an error box when you do these things.
// open module edit
Object obj, oSource, oTarget
ModName_ mn
LinkRef lr
Link lnk, lNew
Module mLM, mSource, mTarget
string ErrMess
Module mCurr = current
for obj in entire mCurr do
{ if (isDeleted(obj)) continue
for lr in obj <-"*" do
{ mn = source(lr)
edit(fullName(mn))
} // end opening all source modules Edit
for lnk in obj <-"*" do
{ mLM = module(lnk)
oSource = source(lnk)
mSource = module(source(lnk))
if (null mSource !isEdit(mSource)) continue, log some error first
if (null oSource) continue,log some error
if (null mLM) cOntinue, log some error
noError()
lNew = oSource ->fullName(mLM) ->obj
ErrMess = lastError()
if (null lNew or !null ErrMess) log create-link error; except link already exists
} // end re-creating in-links
for lnk in obj ->"*" do
{ mTarget = target(lnk)
edit(fullName(mTarget))
mLM = module(lnk)
oTarget = target(lnk)
if (null mTarget or !isEdit(mTarget)...
if (null mLM) ...
if (null oTarget) ...
noError()
lNew = obj -> fullName(mLM) ->oTarget
ErrMess = lastError()
if (null lNew or !null ErrMess) log create-link error, unless its a link-aleady exists error
} // end re-creating outlinks
} // end for all objects
for mSource in database do
{ if (isEdit(mSource)) save(mSource)
if (mSource != mCurr) close(mSource)
} // end closing residual open modules
|
Re: Restoring Links from target module. llandale - Mon May 24 17:43:04 EDT 2010
I think the follow link will find an object NEAR the link-source-object, if that source is excluded from the current view. It may also happen when the source object is deleled. But I see you get an error box when you do these things.
// open module edit
Object obj, oSource, oTarget
ModName_ mn
LinkRef lr
Link lnk, lNew
Module mLM, mSource, mTarget
string ErrMess
Module mCurr = current
for obj in entire mCurr do
{ if (isDeleted(obj)) continue
for lr in obj <-"*" do
{ mn = source(lr)
edit(fullName(mn))
} // end opening all source modules Edit
for lnk in obj <-"*" do
{ mLM = module(lnk)
oSource = source(lnk)
mSource = module(source(lnk))
if (null mSource !isEdit(mSource)) continue, log some error first
if (null oSource) continue,log some error
if (null mLM) cOntinue, log some error
noError()
lNew = oSource ->fullName(mLM) ->obj
ErrMess = lastError()
if (null lNew or !null ErrMess) log create-link error; except link already exists
} // end re-creating in-links
for lnk in obj ->"*" do
{ mTarget = target(lnk)
edit(fullName(mTarget))
mLM = module(lnk)
oTarget = target(lnk)
if (null mTarget or !isEdit(mTarget)...
if (null mLM) ...
if (null oTarget) ...
noError()
lNew = obj -> fullName(mLM) ->oTarget
ErrMess = lastError()
if (null lNew or !null ErrMess) log create-link error, unless its a link-aleady exists error
} // end re-creating outlinks
} // end for all objects
for mSource in database do
{ if (isEdit(mSource)) save(mSource)
if (mSource != mCurr) close(mSource)
} // end closing residual open modules
I found 26 errors in the script.Can you please help me to resolve these errors. I think by mistake you commited some syntax errors in the script. i.e countinue on line 21st. I am new to DXL.Please suggest |
Re: Restoring Links from target module. 1. go to the link properties of one of the "missing" links and note the source ID (Absolute Number of Source Object), the source FULL name, the target ID (Absolute Number of Target Object), the target module full name and the link module full name 2. Open the right source module, press Ctrl-G (goto) enter the source ID to go to the object. Check that the object really has the correct Absolute Number. 3. Go to the link properties of the source object. Check if the link is there. 4. Check your access to the source module, target module and the link module in the module properties. Make sure you have read access to all of them. Check if you get a message "Source object of the link has been deleted" when you follow the link. If source object and target object are there and you have access to everything and the source link arrows still don't show up you are either facing data corruption of your module or you might face this problem because of your DOORS environment (I experienced the problem of link arrows disappearing and reapperaring in a citrix environment once). I would not resort to just ignoring the problem and only recreating the links. Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Restoring Links from target module. Mathias Mamsch - Tue May 25 02:54:51 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS But I am not able to find the these IDs in the properties. I will love to do it by DXL.Beucase I have 3500 links in this module. Becuase Its the only way which will make my life easy. Please help. Thanks and Regards, AJ |
Re: Restoring Links from target module. DOORS_AJ - Mon May 24 18:53:18 EDT 2010 Link History 'existed' but was not recorded until DOORS v8. Read Mathias' post again carefully. If you are in the Target module and the object->link properties does not state the source module/absno, then its unlikely my script will do anything since they both surely use the 'source' functions to figure out those sources. I wonder if you can see the links if you lack R access to the link module. I wonder what happens when you lack R rights to the source Object.
|
Re: Restoring Links from target module. DOORS_AJ - Tue May 25 13:35:29 EDT 2010
The problem is that as long as we don't know what is going on with your links, we cannot write a script. We have three possibilities:
/*
Kitchen Tools for customizing DOORS with DXL V7.1
-------------------------------------------------
DISCLAIMER:
This programming tool has been thoroughly checked
and tested at all stages of its production.
Telelogic cannot accept any responsibility for
any loss, disruption or damage to your data or
your computer system that may occur while using
this script.
If you do not accept these conditions, do not use
this customised script.
-------------------------------------------------
*/
// Copyright (c) 1999 Quality Systems & Software Ltd.
// See DOORS manuals for copying conditions
/*
Sometimes, when you delete modules and objects, links are left hanging around.
This script fixes it.
*/
// Revised by kw 29/09/99: corrected some bugs and hazards (see below)
// skip list to record links to delete
Skip linksToDelete = create
// go through all (incoming- and outgoing-) links of object o and look for null links
int findDudLinks(Object o, string lnkModName) {
Object s
int count = 0
// record current module
Module currMod = current
// open all linked modules
LinkRef lr
for lr in o<-lnkModName do
{
string mn = fullName(source(lr))
if (exists module mn && !isDeleted module mn) edit(mn, false) // check if module esists at all and is not deleted
}
// check incoming links
Link l
for l in o<-lnkModName do {
s = source l
if ( null s ) {
put(linksToDelete, l, l)
count++
}
}
// check outgoing links
for l in o->lnkModName do {
s = target l
if ( null s ) {
string mn = fullName(target l) // load targets module !
// check that the module esists at all and is not deleted
if (exists module mn && !isDeleted module mn) read(mn, false)
s = target l
}
if ( null s ) {
put(linksToDelete, l, l)
count++
}
}
// restore current module
current = currMod
return count
}
string modName
Object o
Link l
int n = 0
Item it
for it in current Project do
{ // go through all modules in current project
modName = fullName(it)
if ( null module modName || type module modName != "Formal" || modName == "Users")
continue
Module m = read(modName, false)
// print "Modul: " modName "\n"
for o in m do
n += findDudLinks(o, "*")
if ( n == 0 ) {
print "No stale links to delete in " m."Name" "."
continue
}
// delete links
for l in linksToDelete do {
string srcName = source l
string tgtName = target l
string modName = fullName module l
print "Stale Link: " srcName ":" (sourceAbsNo l) " -> " modName " -> " tgtName ":" (targetAbsNo l) "\n"
}
flushDeletions
}
delete linksToDelete
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Restoring Links from target module. Can anyone help with this? Thank you! |
Re: Restoring Links from target module. Mathias Mamsch - Tue May 25 15:13:08 EDT 2010
The problem is that as long as we don't know what is going on with your links, we cannot write a script. We have three possibilities:
/*
Kitchen Tools for customizing DOORS with DXL V7.1
-------------------------------------------------
DISCLAIMER:
This programming tool has been thoroughly checked
and tested at all stages of its production.
Telelogic cannot accept any responsibility for
any loss, disruption or damage to your data or
your computer system that may occur while using
this script.
If you do not accept these conditions, do not use
this customised script.
-------------------------------------------------
*/
// Copyright (c) 1999 Quality Systems & Software Ltd.
// See DOORS manuals for copying conditions
/*
Sometimes, when you delete modules and objects, links are left hanging around.
This script fixes it.
*/
// Revised by kw 29/09/99: corrected some bugs and hazards (see below)
// skip list to record links to delete
Skip linksToDelete = create
// go through all (incoming- and outgoing-) links of object o and look for null links
int findDudLinks(Object o, string lnkModName) {
Object s
int count = 0
// record current module
Module currMod = current
// open all linked modules
LinkRef lr
for lr in o<-lnkModName do
{
string mn = fullName(source(lr))
if (exists module mn && !isDeleted module mn) edit(mn, false) // check if module esists at all and is not deleted
}
// check incoming links
Link l
for l in o<-lnkModName do {
s = source l
if ( null s ) {
put(linksToDelete, l, l)
count++
}
}
// check outgoing links
for l in o->lnkModName do {
s = target l
if ( null s ) {
string mn = fullName(target l) // load targets module !
// check that the module esists at all and is not deleted
if (exists module mn && !isDeleted module mn) read(mn, false)
s = target l
}
if ( null s ) {
put(linksToDelete, l, l)
count++
}
}
// restore current module
current = currMod
return count
}
string modName
Object o
Link l
int n = 0
Item it
for it in current Project do
{ // go through all modules in current project
modName = fullName(it)
if ( null module modName || type module modName != "Formal" || modName == "Users")
continue
Module m = read(modName, false)
// print "Modul: " modName "\n"
for o in m do
n += findDudLinks(o, "*")
if ( n == 0 ) {
print "No stale links to delete in " m."Name" "."
continue
}
// delete links
for l in linksToDelete do {
string srcName = source l
string tgtName = target l
string modName = fullName module l
print "Stale Link: " srcName ":" (sourceAbsNo l) " -> " modName " -> " tgtName ":" (targetAbsNo l) "\n"
}
flushDeletions
}
delete linksToDelete
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Also, in each document, I created parent and child views. Even though the Parent document doesn't acknowledge the in-links through "child views", the "child" document recognizes all of the parents in the "parents views. I can definitely say that they are not deleted objects, I do not have access issues, and since I can get the link to show up in both documents by "following" it, I know its there. However, the database that I am working in was restored from an archive. The original database does not show this issue. It would help alot to not have to "follow" every link Any thoughts? HNP Heidi |
Re: Restoring Links from target module. SystemAdmin - Wed Dec 12 18:13:11 EST 2012 Paul Miller, Melbourne, Australia |
Re: Restoring Links from target module. SystemAdmin - Wed Dec 12 18:33:01 EST 2012 Paul Miller, Melbourne, Australia Paul Miller, Melbourne, Australia |
Re: Restoring Links from target module. SystemAdmin - Wed Dec 12 18:13:11 EST 2012 Haven't seen this bug for a while. The solution is to simply access every such link. Although the symtom is in the Target module, the solution is in the source module.
Module mSource = edit(NameSource)
Object obj
Link lnk
Date dat
for obj in entire (current Module) do
{ for lnk in all obj->"*" do
{ dat = lnk."Created On" // Not sure what this does, but it seems to "activate" the link
}
}
save(mSource) // even though no changes are made
close(mSource)
|